<%= header %>
<script src="50-link-tag.js" type="text/javascript"></script>
<%= boomerangScript %>
<script>
BOOMR_test.init({
	"instrument_xhr": true,
	testAfterOnBeacon: (BOOMR.plugins.AutoXHR) ? 2 : 1,
	afterFirstBeacon:
		function() {
			if (!BOOMR.plugins.AutoXHR) {
				return;
			}

			// first, start an XHR to trigger AutoXHR
			var xhr = new XMLHttpRequest();
			xhr.open("GET", "/pages/07-autoxhr/support/img.jpg?id=xhr&rnd=" + Math.random(), true);
			xhr.onreadystatechange = function() {
				if (xhr.readyState !== 4) {
					return;
				}

				// next, add a 2-second LINK tag that should get tracked
				var linkTag = document.createElement("LINK");
				linkTag.rel = "stylesheet";
				linkTag.href = "/delay?delay=2000&file=/assets/blank.js?rnd=" + Math.random();
				document.body.appendChild(linkTag);
			};
			xhr.send(null);
		}
});
</script>
<%= footer %>
